/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.taglib;

import com.minierp.helper.EncCommonHelper;
import java.math.BigDecimal;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class ParseBigDecimal extends TagSupport {
	private static final long serialVersionUID = 1L;
	private BigDecimal source;
	private Integer scale;

	public Integer getScale() {
		return this.scale;
	}

	public void setScale(Integer scale) {
		this.scale = scale;
	}

	public int doStartTag() throws JspException {
		try {
			JspWriter e = this.pageContext.getOut();
			if (this.scale != null) {
				this.source = this.source.setScale(this.scale.intValue(), 4);
			}

			String str = EncCommonHelper.parseBigDecimal(this.source);
			e.print(str);
			return 0;
		} catch (Exception arg2) {
			throw new JspException(arg2.toString());
		}
	}

	public int doEndTag() {
		return 6;
	}

	public BigDecimal getSource() {
		return this.source;
	}

	public void setSource(BigDecimal source) {
		this.source = source;
	}
}